#include "StdAfx.h"
#include "Pos.h"
#include "math.h"

CPos::CPos(void)
{
	m_dblPosX=0;
	m_dblPosY=0;
	m_dblPosZ=0;
}

CPos::CPos(double dblX, double dblY, double dblZ)
{
	m_dblPosX=dblX;
	m_dblPosY=dblY;
	m_dblPosZ=dblZ;
}

CPos::~CPos(void)
{
}

bool CPos::IsSamePos(const CPos & pos, double dblTol) const
{
	double dist=sqrt((pos.GetPosX()-m_dblPosX)*(pos.GetPosX()-m_dblPosX)+(pos.GetPosY()-m_dblPosY)*(pos.GetPosY()-m_dblPosY)+(pos.GetPosZ()-m_dblPosZ)*(pos.GetPosZ()-m_dblPosZ));
	if(dist<dblTol)
		return true;

	return false;
}

double CPos::GetPosX() const
{
	return m_dblPosX;
}

void CPos::SetPosX(double dblX)
{
	m_dblPosX=dblX;
}

double CPos::GetPosY() const
{
	return m_dblPosY;
}

void CPos::SetPosY(double dblY)
{
	m_dblPosY=dblY;
}

double CPos::GetPosZ() const
{
	return m_dblPosZ;
}

void CPos::SetPosZ(double dblZ)
{
	m_dblPosZ=dblZ;
}